<template>
  <div class="alipay">
    <order-header title="支付宝支付">
      <span slot="desc">温馨提示： 请注意钓鱼网站和金融诈骗哦</span>
    </order-header>
    <loading v-if="isLoading"></loading>
    <div class="content" v-html="content"></div>
  </div>
</template>

<script>
import OrderHeader from "components/orderheader/OrderHeader";
import Loading from "components/loading/Loading";
export default {
  name: "AliPay",
  components: {
    OrderHeader,
    Loading,
  },
  data() {
    return {
      content: "",
      orderId: "",
      isLoading: true,
    };
  },
  mounted() {
    console.log(this.$route);
    // 获取地址栏中传递过来的订单id
    this.orderId = this.$route.query.orderId;
    // 调用接口发起支付请求，并将服务器返回的链接渲染到页面
    this.submitPay();
  },
  methods: {
    submitPay() {
     setTimeout(() => {
        document.forms[0].submit();
      }, 500);
    },
  },
};
</script>
<style scoped>
</style>
